<?php
/**
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

/**
 * @package		Joomla.Site
 * @subpackage	mod_menu
 * @since		1.5
 */
class modNewsHelper
{
	/**
	 * Get a list of the menu items.
	 *
	 * @param	JRegistry	$params	The module options.
	 *
	 * @return	array
	 * @since	1.5
	 */
	static function getListCategory( $catid1 )
	{
		$db		= JFactory::getDbo();
		$query	= "SELECT * FROM `#__content` WHERE catid = ".$catid1." ORDER BY id desc limit 0,1 ";
		$db->setQuery( $query );	
		return $db->loadObject();
	}
	function wrapText( $text, $nb ){
		$text = strip_tags( $text );
		$text = substr($text, 0, $nb);
		return $text;
	}
}
